package com.tarena.demo.luban.all.main.controller;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "hello")
public class HelloController {

    @Value("${server.port}")
    private String port;

    @GetMapping("/hello")
    public String sayHi(String name) {
        String response = "hello [" + name + "], I'm from [" + port + "]";
        return response;
    }

    @GetMapping("/bye")
    public String sayBye(String name){
        return "bye "+name+",I am from ["+port+"]";
    }
    @GetMapping("/cart/add/{id}")
    public String get(@PathVariable String id){
        return "";
    }

}
